Optimal. Leaf size=163 \[ -\frac {a \left (4 a^2-3 b^2\right ) x}{b^5}+\frac {2 \left (4 a^4-5 a^2 b^2+b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{b^5 \sqrt {a^2-b^2} d}+\frac {\cos ^3(c+d x) (4 a+b \sin (c+d x))}{3 b^2 d (a+b \sin (c+d x))}-\frac {\cos (c+d x) \left (4 a^2-b^2-2 a b \sin (c+d x)\right )}{b^4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.20, antiderivative size = 163, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2942, 2944,
2814, 2739, 632, 210} \begin {gather*} -\frac {a x \left (4 a^2-3 b^2\right )}{b^5}-\frac {\cos (c+d x) \left (4 a^2-2 a b \sin (c+d x)-b^2\right )}{b^4 d}+\frac {2 \left (4 a^4-5 a^2 b^2+b^4\right ) \text {ArcTan}\left (\frac {a \tan \left (\frac {1}{2} (c+d x)\right )+b}{\sqrt {a^2-b^2}}\right )}{b^5 d \sqrt {a^2-b^2}}+\frac {\cos ^3(c+d x) (4 a+b \sin (c+d x))}{3 b^2 d (a+b \sin (c+d x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2814
Rule 2942
Rule 2944
Rubi steps
\begin {align*} \int \frac {\cos ^4(c+d x) \sin (c+d x)}{(a+b \sin (c+d x))^2} \, dx &=\frac {\cos ^3(c+d x) (4 a+b \sin (c+d x))}{3 b^2 d (a+b \sin (c+d x))}-\frac {\int \frac {\cos ^2(c+d x) (-b-4 a \sin (c+d x))}{a+b \sin (c+d x)} \, dx}{b^2}\\ &=\frac {\cos ^3(c+d x) (4 a+b \sin (c+d x))}{3 b^2 d (a+b \sin (c+d x))}-\frac {\cos (c+d x) \left (4 a^2-b^2-2 a b \sin (c+d x)\right )}{b^4 d}-\frac {\int \frac {2 b \left (2 a^2-b^2\right )+2 a \left (4 a^2-3 b^2\right ) \sin (c+d x)}{a+b \sin (c+d x)} \, dx}{2 b^4}\\ &=-\frac {a \left (4 a^2-3 b^2\right ) x}{b^5}+\frac {\cos ^3(c+d x) (4 a+b \sin (c+d x))}{3 b^2 d (a+b \sin (c+d x))}-\frac {\cos (c+d x) \left (4 a^2-b^2-2 a b \sin (c+d x)\right )}{b^4 d}+\frac {\left (4 a^4-5 a^2 b^2+b^4\right ) \int \frac {1}{a+b \sin (c+d x)} \, dx}{b^5}\\ &=-\frac {a \left (4 a^2-3 b^2\right ) x}{b^5}+\frac {\cos ^3(c+d x) (4 a+b \sin (c+d x))}{3 b^2 d (a+b \sin (c+d x))}-\frac {\cos (c+d x) \left (4 a^2-b^2-2 a b \sin (c+d x)\right )}{b^4 d}+\frac {\left (2 \left (4 a^4-5 a^2 b^2+b^4\right )\right ) \text {Subst}\left (\int \frac {1}{a+2 b x+a x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^5 d}\\ &=-\frac {a \left (4 a^2-3 b^2\right ) x}{b^5}+\frac {\cos ^3(c+d x) (4 a+b \sin (c+d x))}{3 b^2 d (a+b \sin (c+d x))}-\frac {\cos (c+d x) \left (4 a^2-b^2-2 a b \sin (c+d x)\right )}{b^4 d}-\frac {\left (4 \left (4 a^4-5 a^2 b^2+b^4\right )\right ) \text {Subst}\left (\int \frac {1}{-4 \left (a^2-b^2\right )-x^2} \, dx,x,2 b+2 a \tan \left (\frac {1}{2} (c+d x)\right )\right )}{b^5 d}\\ &=-\frac {a \left (4 a^2-3 b^2\right ) x}{b^5}+\frac {2 \left (4 a^4-5 a^2 b^2+b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{b^5 \sqrt {a^2-b^2} d}+\frac {\cos ^3(c+d x) (4 a+b \sin (c+d x))}{3 b^2 d (a+b \sin (c+d x))}-\frac {\cos (c+d x) \left (4 a^2-b^2-2 a b \sin (c+d x)\right )}{b^4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.65, size = 247, normalized size = 1.52 \begin {gather*} \frac {\frac {48 \left (4 a^4-5 a^2 b^2+b^4\right ) \tan ^{-1}\left (\frac {b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\sqrt {a^2-b^2}}+\frac {-96 a^4 c+72 a^2 b^2 c-96 a^4 d x+72 a^2 b^2 d x+\left (-96 a^3 b+60 a b^3\right ) \cos (c+d x)-4 a b^3 \cos (3 (c+d x))-96 a^3 b c \sin (c+d x)+72 a b^3 c \sin (c+d x)-96 a^3 b d x \sin (c+d x)+72 a b^3 d x \sin (c+d x)-24 a^2 b^2 \sin (2 (c+d x))+14 b^4 \sin (2 (c+d x))+b^4 \sin (4 (c+d x))}{a+b \sin (c+d x)}}{24 b^5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.45, size = 276, normalized size = 1.69
method | result | size |
derivativedivides | \(\frac {-\frac {4 \left (\frac {\frac {a \,b^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\left (\frac {3}{2} a^{2} b -b^{3}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a^{2} b -b^{3}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a \,b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}+\frac {3 a^{2} b}{2}-\frac {2 b^{3}}{3}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {a \left (4 a^{2}-3 b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{b^{5}}+\frac {\frac {4 \left (-\frac {b^{2} \left (a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}-\frac {a^{3} b}{2}+\frac {a \,b^{3}}{2}\right )}{a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a}+\frac {2 \left (4 a^{4}-5 a^{2} b^{2}+b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}}{b^{5}}}{d}\) | \(276\) |
default | \(\frac {-\frac {4 \left (\frac {\frac {a \,b^{2} \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}+\left (\frac {3}{2} a^{2} b -b^{3}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (3 a^{2} b -b^{3}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a \,b^{2} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}+\frac {3 a^{2} b}{2}-\frac {2 b^{3}}{3}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {a \left (4 a^{2}-3 b^{2}\right ) \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2}\right )}{b^{5}}+\frac {\frac {4 \left (-\frac {b^{2} \left (a^{2}-b^{2}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{2}-\frac {a^{3} b}{2}+\frac {a \,b^{3}}{2}\right )}{a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+2 b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+a}+\frac {2 \left (4 a^{4}-5 a^{2} b^{2}+b^{4}\right ) \arctan \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}}{b^{5}}}{d}\) | \(276\) |
risch | \(-\frac {4 a^{3} x}{b^{5}}+\frac {3 a x}{b^{3}}-\frac {i a \,{\mathrm e}^{2 i \left (d x +c \right )}}{4 b^{3} d}-\frac {3 \,{\mathrm e}^{i \left (d x +c \right )} a^{2}}{2 b^{4} d}+\frac {5 \,{\mathrm e}^{i \left (d x +c \right )}}{8 b^{2} d}-\frac {3 \,{\mathrm e}^{-i \left (d x +c \right )} a^{2}}{2 b^{4} d}+\frac {5 \,{\mathrm e}^{-i \left (d x +c \right )}}{8 b^{2} d}+\frac {i a \,{\mathrm e}^{-2 i \left (d x +c \right )}}{4 b^{3} d}+\frac {2 i a \left (-a^{2}+b^{2}\right ) \left (-i a \,{\mathrm e}^{i \left (d x +c \right )}+b \right )}{b^{5} d \left (b \,{\mathrm e}^{2 i \left (d x +c \right )}-b +2 i a \,{\mathrm e}^{i \left (d x +c \right )}\right )}-\frac {4 i \sqrt {a^{2}-b^{2}}\, a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (\sqrt {a^{2}-b^{2}}-a \right )}{b}\right )}{d \,b^{5}}+\frac {i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i \left (\sqrt {a^{2}-b^{2}}-a \right )}{b}\right )}{d \,b^{3}}+\frac {4 i \sqrt {a^{2}-b^{2}}\, a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}+a \right )}{b}\right )}{d \,b^{5}}-\frac {i \sqrt {a^{2}-b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i \left (\sqrt {a^{2}-b^{2}}+a \right )}{b}\right )}{d \,b^{3}}+\frac {\cos \left (3 d x +3 c \right )}{12 d \,b^{2}}\) | \(421\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.45, size = 507, normalized size = 3.11 \begin {gather*} \left [-\frac {4 \, a b^{3} \cos \left (d x + c\right )^{3} + 6 \, {\left (4 \, a^{4} - 3 \, a^{2} b^{2}\right )} d x + 3 \, {\left (4 \, a^{3} - a b^{2} + {\left (4 \, a^{2} b - b^{3}\right )} \sin \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {{\left (2 \, a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2} + 2 \, {\left (a \cos \left (d x + c\right ) \sin \left (d x + c\right ) + b \cos \left (d x + c\right )\right )} \sqrt {-a^{2} + b^{2}}}{b^{2} \cos \left (d x + c\right )^{2} - 2 \, a b \sin \left (d x + c\right ) - a^{2} - b^{2}}\right ) + 6 \, {\left (4 \, a^{3} b - 3 \, a b^{3}\right )} \cos \left (d x + c\right ) - 2 \, {\left (b^{4} \cos \left (d x + c\right )^{3} - 3 \, {\left (4 \, a^{3} b - 3 \, a b^{3}\right )} d x - 3 \, {\left (2 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{6 \, {\left (b^{6} d \sin \left (d x + c\right ) + a b^{5} d\right )}}, -\frac {2 \, a b^{3} \cos \left (d x + c\right )^{3} + 3 \, {\left (4 \, a^{4} - 3 \, a^{2} b^{2}\right )} d x + 3 \, {\left (4 \, a^{3} - a b^{2} + {\left (4 \, a^{2} b - b^{3}\right )} \sin \left (d x + c\right )\right )} \sqrt {a^{2} - b^{2}} \arctan \left (-\frac {a \sin \left (d x + c\right ) + b}{\sqrt {a^{2} - b^{2}} \cos \left (d x + c\right )}\right ) + 3 \, {\left (4 \, a^{3} b - 3 \, a b^{3}\right )} \cos \left (d x + c\right ) - {\left (b^{4} \cos \left (d x + c\right )^{3} - 3 \, {\left (4 \, a^{3} b - 3 \, a b^{3}\right )} d x - 3 \, {\left (2 \, a^{2} b^{2} - b^{4}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{3 \, {\left (b^{6} d \sin \left (d x + c\right ) + a b^{5} d\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 300, normalized size = 1.84 \begin {gather*} -\frac {\frac {3 \, {\left (4 \, a^{3} - 3 \, a b^{2}\right )} {\left (d x + c\right )}}{b^{5}} - \frac {6 \, {\left (4 \, a^{4} - 5 \, a^{2} b^{2} + b^{4}\right )} {\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (a\right ) + \arctan \left (\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + b}{\sqrt {a^{2} - b^{2}}}\right )\right )}}{\sqrt {a^{2} - b^{2}} b^{5}} + \frac {6 \, {\left (a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a^{3} - a b^{2}\right )}}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 2 \, b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + a\right )} b^{4}} + \frac {2 \, {\left (3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 9 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 6 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 18 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 6 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 9 \, a^{2} - 4 \, b^{2}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3} b^{4}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.53, size = 964, normalized size = 5.91 \begin {gather*} \frac {\frac {2\,\left (7\,a\,b^2-12\,a^3\right )}{3\,b^4}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (a\,b^2-4\,a^3\right )}{b^4}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (7\,a\,b^2-12\,a^3\right )}{b^4}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (25\,a\,b^2-36\,a^3\right )}{3\,b^4}-\frac {2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (18\,a^2-11\,b^2\right )}{3\,b^3}-\frac {14\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (2\,a^2-b^2\right )}{b^3}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7\,\left (2\,a^2-b^2\right )}{b^3}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (10\,a^2-7\,b^2\right )}{b^3}}{d\,\left (a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+2\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+4\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+6\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+6\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+6\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+4\,a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+2\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+a\right )}-\frac {2\,\mathrm {atanh}\left (\frac {64\,a^2\,\sqrt {b^2-a^2}}{64\,a^2\,b-\frac {320\,a^4}{b}+\frac {256\,a^6}{b^3}-640\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+128\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {512\,a^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b^2}}-\frac {256\,a^4\,\sqrt {b^2-a^2}}{64\,a^2\,b^3-320\,a^4\,b+\frac {256\,a^6}{b}+512\,a^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+128\,a\,b^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-640\,a^3\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {128\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{64\,a^2-\frac {320\,a^4}{b^2}+\frac {256\,a^6}{b^4}-\frac {640\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}+\frac {512\,a^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b^3}+128\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}-\frac {576\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{64\,a^2\,b^2-320\,a^4+\frac {256\,a^6}{b^2}+128\,a\,b^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-640\,a^3\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+\frac {512\,a^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}}+\frac {256\,a^5\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {b^2-a^2}}{256\,a^6+512\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^5\,b-320\,a^4\,b^2-640\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b^3+64\,a^2\,b^4+128\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^5}\right )\,\left (4\,a^2\,\sqrt {b^2-a^2}-b^2\,\sqrt {b^2-a^2}\right )}{b^5\,d}-\frac {2\,a\,\mathrm {atan}\left (\frac {192\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{192\,a^2-\frac {448\,a^4}{b^2}+\frac {256\,a^6}{b^4}}-\frac {448\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{192\,a^2\,b^2-448\,a^4+\frac {256\,a^6}{b^2}}+\frac {256\,a^6\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{256\,a^6-448\,a^4\,b^2+192\,a^2\,b^4}\right )\,\left (4\,a^2-3\,b^2\right )}{b^5\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________